<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: tilebuffer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_12cda917fe1d7c8b4e7d2501bb3636e4.html">sdk</a></li><li class="navelem"><a class="el" href="dir_2f23e30b638d6a5f333babd9a5d183e1.html">include</a></li><li class="navelem"><a class="el" href="dir_d5ace589187da7c83c1a7507ec9fbbef.html">sifteo</a></li><li class="navelem"><a class="el" href="dir_483499650334b406c1d3bbaf3a730f60.html">video</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">tilebuffer.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* -*- mode: C; c-basic-offset: 4; intent-tabs-mode: nil -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * This file is part of the public interface to the Sifteo SDK.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright &lt;c&gt; 2012 Sifteo, Inc. All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef NOT_USERSPACE</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#   error This is a userspace-only header, not allowed by the current build.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;sifteo/abi.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;sifteo/macros.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;sifteo/math.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;sifteo/asset.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;sifteo/memory.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;sifteo/cube.h&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">namespace </span>Sifteo {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">template</span> &lt;<span class="keywordtype">unsigned</span> tW, <span class="keywordtype">unsigned</span> tH, <span class="keywordtype">unsigned</span> tF = 1&gt;</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html">   51</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_tile_buffer.html" title="A drawable that&#39;s backed by plain memory, instead of by a VideoBuffer.">TileBuffer</a> {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        _SYSAssetImage image;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        _SYSCubeID <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda" title="Return the CubeID associated with this drawable.">cube</a>;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    } sys;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    uint16_t tiles[tW * tH * tF];</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="comment">// Implicit conversion to AssetImage base class</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>&amp; () <span class="keyword">const</span> { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">operator</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>&amp; () { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>* () <span class="keyword">const</span> { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keyword">operator</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>* () { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span><a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="comment">// Implicit conversion to FlatAssetImage</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>&amp; () <span class="keyword">const</span> { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keyword">operator</span> <a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>&amp; () { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>* () <span class="keyword">const</span> { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keyword">operator</span> <a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>* () { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span><a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys.image); }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="comment">// Implicit conversion to system object</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> _SYSAssetImage&amp; () <span class="keyword">const</span> { <span class="keywordflow">return</span> sys.image; }</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keyword">operator</span> _SYSAssetImage&amp; () { <span class="keywordflow">return</span> sys.image; }</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> _SYSAssetImage* () <span class="keyword">const</span> { <span class="keywordflow">return</span> sys.image; }</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keyword">operator</span> _SYSAssetImage* () { <span class="keywordflow">return</span> sys.image; }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda">   79</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda" title="Return the CubeID associated with this drawable.">cube</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordflow">return</span> sys.cube;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    }</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a58fcea7d4742440564185d9b529ffcc5">   93</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a58fcea7d4742440564185d9b529ffcc5" title="Change the CubeID associated with this drawable.">setCube</a>(<a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda" title="Return the CubeID associated with this drawable.">cube</a>) {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        sys.cube = <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda" title="Return the CubeID associated with this drawable.">cube</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    }</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a8775fff50c3eff89afbca5536811702d">  100</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a8775fff50c3eff89afbca5536811702d" title="Initialize the TileBuffer&#39;s AssetImage header.">init</a>() {</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        sys.cube = _SYS_CUBE_ID_INVALID;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <a class="code" href="group__memory.html#ga20938d45e7d2889376bd3151c5a1ce44" title="Write &#39;n&#39; zero bytes to memory.">bzero</a>(sys.image);</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        sys.image.width = tW;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        sys.image.height = tH;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        sys.image.frames = tF;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        sys.image.format = _SYS_AIF_FLAT;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        sys.image.pData = <span class="keyword">reinterpret_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(&amp;tiles[0]);</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a89b0b2e10391a1d4f67db71741025fe7">  116</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a89b0b2e10391a1d4f67db71741025fe7" title="Initialize a TileBuffer.">TileBuffer</a>() {</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a8775fff50c3eff89afbca5536811702d" title="Initialize the TileBuffer&#39;s AssetImage header.">init</a>();</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    }</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#aaf01e48283a2191c414726fa68f5b97b">  131</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aaf01e48283a2191c414726fa68f5b97b" title="Initialize a TileBuffer for use.">TileBuffer</a>(<a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda" title="Return the CubeID associated with this drawable.">cube</a>) {</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a8775fff50c3eff89afbca5536811702d" title="Initialize the TileBuffer&#39;s AssetImage header.">init</a>();</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        sys.cube = <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a259e85cd18617f07957cf0135fb19cda" title="Return the CubeID associated with this drawable.">cube</a>;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2">  140</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        <span class="keywordflow">return</span> tW;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988">  147</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() {</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        <span class="keywordflow">return</span> tH;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a85262607682eb38453d809d8cd929629">  154</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a85262607682eb38453d809d8cd929629" title="Return the size of this mode as a vector, in tiles.">tileSize</a>() {</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>(), <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#acc699b0bb3edd4f152a91e3a98a77aea">  161</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#acc699b0bb3edd4f152a91e3a98a77aea" title="Return the width, in pixels, of this mode.">pixelWidth</a>() {</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() * 8;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    }</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a3a758720a85e0bf47d0a6af2b56de172">  168</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a3a758720a85e0bf47d0a6af2b56de172" title="Return the height, in pixel, of this mode.">pixelHeight</a>() {</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() * 8;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    }</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a25eb3076fa642f6b16ec2f41e40639d1">  175</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a25eb3076fa642f6b16ec2f41e40639d1" title="Return the size of this mode as a vector, in pixels.">pixelSize</a>() {</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_tile_buffer.html#acc699b0bb3edd4f152a91e3a98a77aea" title="Return the width, in pixels, of this mode.">pixelWidth</a>(), <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a3a758720a85e0bf47d0a6af2b56de172" title="Return the height, in pixel, of this mode.">pixelHeight</a>());</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    }</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533">  182</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533" title="Return the number of frames in this image.">numFrames</a>() {</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        <span class="keywordflow">return</span> tF;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    }</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#aebaf4f6c194fceff42d410886d4ad4bf">  189</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aebaf4f6c194fceff42d410886d4ad4bf" title="Return the number of tiles in each frame of the image.">numTilesPerFrame</a>() {</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() * <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>();</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    }</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0">  196</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0" title="Return the total number of tiles in every frame of the image.">numTiles</a>() {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533" title="Return the number of frames in this image.">numFrames</a>() * <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aebaf4f6c194fceff42d410886d4ad4bf" title="Return the number of tiles in each frame of the image.">numTilesPerFrame</a>();</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    }</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a20f356b9308aa85cc35b712f57067783">  203</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a20f356b9308aa85cc35b712f57067783" title="Returns the size of this drawable&#39;s tile data, in bytes.">sizeInBytes</a>() {</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0" title="Return the total number of tiles in every frame of the image.">numTiles</a>() * 2;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#af94160025129d5e4d01cea0810b79373">  210</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#af94160025129d5e4d01cea0810b79373" title="Returns the size of this drawable&#39;s tile data, in 16-bit words.">sizeInWords</a>() {</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0" title="Return the total number of tiles in every frame of the image.">numTiles</a>();</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    }</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div>
<div class="line"><a name="l00218"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#aad26ece0c30f45603a3d500ac3758516">  218</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aad26ece0c30f45603a3d500ac3758516" title="Erase the buffer, filling it with the specified absolute tile index value.">erase</a>(uint16_t index = 0) {</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <a class="code" href="group__memory.html#gabf33fba18a28e7590c7d475a39b7e09e" title="memset(), with an explicit 16-bit data width">memset16</a>(&amp;tiles[0], index, <a class="code" href="struct_sifteo_1_1_tile_buffer.html#af94160025129d5e4d01cea0810b79373" title="Returns the size of this drawable&#39;s tile data, in 16-bit words.">sizeInWords</a>());</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    }</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a42b3da3c6b2095764b1b2233b9e0aae8">  227</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a42b3da3c6b2095764b1b2233b9e0aae8" title="Erase the buffer, filling it with the first tile from the specified PinnedAssetImage.">erase</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;image) {</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aad26ece0c30f45603a3d500ac3758516" title="Erase the buffer, filling it with the specified absolute tile index value.">erase</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0));</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    }</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85">  236</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> frame = 0) {</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;        <span class="keywordflow">return</span> pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + (pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + frame * <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>()) * <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>();</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    }</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a0fa614f8b2cfb56216fc1f07af7ef8f0">  247</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a0fa614f8b2cfb56216fc1f07af7ef8f0" title="Plot a single tile, by absolute tile index, at linear position &#39;i&#39;.">plot</a>(<span class="keywordtype">unsigned</span> i, uint16_t tileIndex) {</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(i &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0" title="Return the total number of tiles in every frame of the image.">numTiles</a>());</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;        tiles[i] = tileIndex;</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    }</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;</div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#aca291e8c8e981743e16a1a25de3c7b26">  259</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aca291e8c8e981743e16a1a25de3c7b26" title="Plot a single tile, by absolute tile index, at location &#39;pos&#39; in tile units, on the given frame...">plot</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, uint16_t tileIndex, <span class="keywordtype">unsigned</span> frame = 0) {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; frame &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        tiles[<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, frame)] = tileIndex;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a4cd9de1a2101a45d8182f91538604c33">  268</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a4cd9de1a2101a45d8182f91538604c33" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(<span class="keywordtype">unsigned</span> i)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(i &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0" title="Return the total number of tiles in every frame of the image.">numTiles</a>());</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        <span class="keywordflow">return</span> tiles[i];</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    }</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div>
<div class="line"><a name="l00278"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#afd9637274b0ce32db818127662e427fa">  278</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_tile_buffer.html#afd9637274b0ce32db818127662e427fa" title="Return the index of the tile at the specified (x, y) tile coordinates, and optionally on the specifie...">tile</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> pos, <span class="keywordtype">unsigned</span> frame = 0)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; frame &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        <span class="keywordflow">return</span> tiles[<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, frame)];</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    }</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a94d50b7f1c63359f3df08edb963b2aba">  290</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a94d50b7f1c63359f3df08edb963b2aba" title="Plot a horizontal span of tiles, by absolute tile index, given the position of the leftmost tile and ...">span</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> width, <span class="keywordtype">unsigned</span> tileIndex, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    {</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; width &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;            (pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + width) &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;        <a class="code" href="group__memory.html#gabf33fba18a28e7590c7d475a39b7e09e" title="memset(), with an explicit 16-bit data width">memset16</a>(&amp;tiles[<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, frame)], tileIndex, width);</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    }</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;</div>
<div class="line"><a name="l00303"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a7901aeab575a81bd790a8a68fc97de3d">  303</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a94d50b7f1c63359f3df08edb963b2aba" title="Plot a horizontal span of tiles, by absolute tile index, given the position of the leftmost tile and ...">span</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> width, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;image, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    {</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a94d50b7f1c63359f3df08edb963b2aba" title="Plot a horizontal span of tiles, by absolute tile index, given the position of the leftmost tile and ...">span</a>(pos, width, image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0), frame);</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    }</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;</div>
<div class="line"><a name="l00314"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a613627590aede7bc857a33c312bf4f2c">  314</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a613627590aede7bc857a33c312bf4f2c" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keywordtype">unsigned</span> tileIndex, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    {</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;        <span class="keywordflow">while</span> (size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>) {</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;            <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a94d50b7f1c63359f3df08edb963b2aba" title="Plot a horizontal span of tiles, by absolute tile index, given the position of the leftmost tile and ...">span</a>(topLeft, size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>, tileIndex, frame);</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;            size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>--;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;            topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>++;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        }</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    }</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;</div>
<div class="line"><a name="l00329"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#a839ec2e633c18c75c105b61db2d30230">  329</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a613627590aede7bc857a33c312bf4f2c" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;image, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    {</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a613627590aede7bc857a33c312bf4f2c" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(topLeft, size, image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(sys.cube, 0), frame);</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    }</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;</div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#af7b76646c68696d97537830024e9ce03">  343</a></span>&#160;    <span class="keywordtype">void</span> image(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;image, <span class="keywordtype">unsigned</span> srcFrame = 0, <span class="keywordtype">unsigned</span> destFrame = 0)</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;    {</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + image.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>() &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;               pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + image.<a class="code" href="struct_sifteo_1_1_asset_image.html#a7ff2fd5e83e49e79b376df2c8b156bbd" title="The height of this image, in tiles.">tileHeight</a>() &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp;</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;               destFrame &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        _SYS_image_memDraw(&amp;tiles[<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, destFrame)], sys.cube, image, <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>(), srcFrame);</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    }</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;</div>
<div class="line"><a name="l00361"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#ab31d68fa3fa94735a0c5c8d3dfeece93">  361</a></span>&#160;    <span class="keywordtype">void</span> image(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> destXY, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;image, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> srcXY,</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;        <span class="keywordtype">unsigned</span> srcFrame = 0, <span class="keywordtype">unsigned</span> destFrame = 0)</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;    {</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;               destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a314f87fa435dae08e6224a1858b9a988" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp;</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;               destFrame &lt; <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a431298fcb7ea9d9eb08a541ce6d5a533" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;        _SYS_image_memDrawRect(&amp;tiles[<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(destXY, destFrame)], sys.cube,</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;            image, <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>(), srcFrame, (_SYSInt2*) &amp;srcXY, (_SYSInt2*) &amp;size);</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    }</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;</div>
<div class="line"><a name="l00378"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_tile_buffer.html#aacaaed12707ad3bbc060eb361e8c5880">  378</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_tile_buffer.html#aacaaed12707ad3bbc060eb361e8c5880" title="Draw text, using an AssetImage as a fixed width font.">text</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> topLeft, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;font, <span class="keyword">const</span> <span class="keywordtype">char</span> *str,</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;        <span class="keywordtype">unsigned</span> destFrame = 0, <span class="keywordtype">char</span> firstChar = <span class="charliteral">&#39; &#39;</span>)</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    {</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.cube != _SYS_CUBE_ID_INVALID);</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;        uint16_t *addr = &amp;tiles[<a class="code" href="struct_sifteo_1_1_tile_buffer.html#a5279b36d506611c2c16026a3e8fe4d85" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(topLeft, destFrame)];</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;        uint16_t *lineAddr = addr;</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;        <span class="keywordtype">char</span> c;</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;        <span class="keywordflow">while</span> ((c = *str)) {</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;            <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;\n&#39;</span>) {</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;                addr = (lineAddr += <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>());</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;                <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(font.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>() + (font.<a class="code" href="struct_sifteo_1_1_asset_image.html#a7ff2fd5e83e49e79b376df2c8b156bbd" title="The height of this image, in tiles.">tileHeight</a>() - 1) * <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>() + addr</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;                    &lt;= <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a76ca3009d6d1e9b1f85205e5ab5e45e0" title="Return the total number of tiles in every frame of the image.">numTiles</a>() + tiles);</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;                _SYS_image_memDraw(addr, sys.cube, font, <a class="code" href="struct_sifteo_1_1_tile_buffer.html#a55db165ff4891839cfc3a158da33b2d2" title="Return the width, in tiles, of this mode.">tileWidth</a>(), c - firstChar);</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;                addr += font.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>();</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;            }</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;            str++;</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;        }</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;    }</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;};</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;<span class="keyword">template</span> &lt;<span class="keywordtype">unsigned</span> tW, <span class="keywordtype">unsigned</span> tH, <span class="keywordtype">unsigned</span> tF = 1&gt;</div>
<div class="line"><a name="l00429"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html">  429</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html" title="A drawable that&#39;s backed by plain memory, usable with multiple cubes.">RelocatableTileBuffer</a> {</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;    _SYSAssetImage sys;</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;    uint16_t tiles[tW * tH * tF];</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;</div>
<div class="line"><a name="l00434"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1c446b5813f53c9b9903867daa411989">  434</a></span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>&amp; () <span class="keyword">const</span> { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    <span class="keyword">operator</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>&amp; () { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> AssetImage* () <span class="keyword">const</span> { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>AssetImage*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    <span class="keyword">operator</span> AssetImage* () { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span>AssetImage*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;</div>
<div class="line"><a name="l00440"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad8fec5b4f1e4113e7a85fbfea50399a8">  440</a></span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>&amp; () <span class="keyword">const</span> { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;    <span class="keyword">operator</span> <a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>&amp; () { <span class="keywordflow">return</span> *<span class="keyword">reinterpret_cast&lt;</span><a class="code" href="struct_sifteo_1_1_flat_asset_image.html" title="An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...">FlatAssetImage</a>*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> FlatAssetImage* () <span class="keyword">const</span> { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>FlatAssetImage*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;    <span class="keyword">operator</span> FlatAssetImage* () { <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span>FlatAssetImage*<span class="keyword">&gt;</span>(&amp;sys); }</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;</div>
<div class="line"><a name="l00446"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a4acea990cab70474b4990e320d9efc23">  446</a></span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> _SYSAssetImage&amp; () <span class="keyword">const</span> { <span class="keywordflow">return</span> sys; }</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;    <span class="keyword">operator</span> _SYSAssetImage&amp; () { <span class="keywordflow">return</span> sys; }</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> _SYSAssetImage* () <span class="keyword">const</span> { <span class="keywordflow">return</span> sys; }</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    <span class="keyword">operator</span> _SYSAssetImage* () { <span class="keywordflow">return</span> sys; }</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;</div>
<div class="line"><a name="l00457"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1f90a5913120b0e276bb419248d08f47">  457</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1f90a5913120b0e276bb419248d08f47" title="Initialize the RelocatableTileBuffer&#39;s AssetImage header.">init</a>() {</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;        <a class="code" href="group__memory.html#ga20938d45e7d2889376bd3151c5a1ce44" title="Write &#39;n&#39; zero bytes to memory.">bzero</a>(sys);</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;        sys.width = tW;</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;        sys.height = tH;</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;        sys.frames = tF;</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;        sys.format = _SYS_AIF_FLAT;</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;        sys.pData = <span class="keyword">reinterpret_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(&amp;tiles[0]);</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    }</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;</div>
<div class="line"><a name="l00469"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a68afef1edd95a9eddd9652c38b6132c7">  469</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a68afef1edd95a9eddd9652c38b6132c7" title="Initialize a RelocatableTileBuffer.">RelocatableTileBuffer</a>() {</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1f90a5913120b0e276bb419248d08f47" title="Initialize the RelocatableTileBuffer&#39;s AssetImage header.">init</a>();</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;    }</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;</div>
<div class="line"><a name="l00476"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a">  476</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() {</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;        <span class="keywordflow">return</span> tW;</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;    }</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;</div>
<div class="line"><a name="l00483"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92">  483</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() {</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;        <span class="keywordflow">return</span> tH;</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;    }</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;</div>
<div class="line"><a name="l00490"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#abcc34ae0aaca931fc4c5965053cce99d">  490</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#abcc34ae0aaca931fc4c5965053cce99d" title="Return the size of this mode as a vector, in tiles.">tileSize</a>() {</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>(), <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;    }</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;</div>
<div class="line"><a name="l00497"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a30ee41eb962f40b5d13833bd42347a43">  497</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a30ee41eb962f40b5d13833bd42347a43" title="Return the width, in pixels, of this mode.">pixelWidth</a>() {</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() * 8;</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    }</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;</div>
<div class="line"><a name="l00504"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a67ddd9895d4865cc39fa6e3268bc411e">  504</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a67ddd9895d4865cc39fa6e3268bc411e" title="Return the height, in pixel, of this mode.">pixelHeight</a>() {</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() * 8;</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;    }</div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;</div>
<div class="line"><a name="l00511"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8fb811bfa95fbdbe5e6f3e44d57280af">  511</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8fb811bfa95fbdbe5e6f3e44d57280af" title="Return the size of this mode as a vector, in pixels.">pixelSize</a>() {</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__math.html#gab18c9af04a4a3a4a3c63656e40ab74ed" title="Create a Vector2, from a set of (x,y) coordinates.">vec</a>(<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a30ee41eb962f40b5d13833bd42347a43" title="Return the width, in pixels, of this mode.">pixelWidth</a>(), <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a67ddd9895d4865cc39fa6e3268bc411e" title="Return the height, in pixel, of this mode.">pixelHeight</a>());</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;    }</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;</div>
<div class="line"><a name="l00518"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f">  518</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f" title="Return the number of frames in this image.">numFrames</a>() {</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;        <span class="keywordflow">return</span> tF;</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;    }</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;</div>
<div class="line"><a name="l00525"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad0a3fe97a65f6692ee3c66206ccc75b3">  525</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad0a3fe97a65f6692ee3c66206ccc75b3" title="Return the number of tiles in each frame of the image.">numTilesPerFrame</a>() {</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() * <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>();</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;    }</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;</div>
<div class="line"><a name="l00532"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b">  532</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b" title="Return the total number of tiles in every frame of the image.">numTiles</a>() {</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f" title="Return the number of frames in this image.">numFrames</a>() * <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad0a3fe97a65f6692ee3c66206ccc75b3" title="Return the number of tiles in each frame of the image.">numTilesPerFrame</a>();</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;    }</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;</div>
<div class="line"><a name="l00539"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ae3eb78720e927543cc207f329620d8e4">  539</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ae3eb78720e927543cc207f329620d8e4" title="Returns the size of this drawable&#39;s tile data, in bytes.">sizeInBytes</a>() {</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b" title="Return the total number of tiles in every frame of the image.">numTiles</a>() * 2;</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;    }</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;</div>
<div class="line"><a name="l00546"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a74e1b997c412645e51c6bf99f6e970a0">  546</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a74e1b997c412645e51c6bf99f6e970a0" title="Returns the size of this drawable&#39;s tile data, in 16-bit words.">sizeInWords</a>() {</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b" title="Return the total number of tiles in every frame of the image.">numTiles</a>();</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;    }</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;</div>
<div class="line"><a name="l00555"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf">  555</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(<a class="code" href="struct_sifteo_1_1_asset_group.html" title="A bundle of compressed tile data, for use by AssetImages.">AssetGroup</a> &amp;group) {</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;        uint32_t pAssetGroup = <span class="keyword">reinterpret_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(&amp;group.sys);</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(sys.pAssetGroup == 0 || sys.pAssetGroup == pAssetGroup);</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;        sys.pAssetGroup = pAssetGroup;</div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;    }</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;</div>
<div class="line"><a name="l00565"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#abedc46569e3b27d25b6f84436f7f7d1f">  565</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#abedc46569e3b27d25b6f84436f7f7d1f" title="Erase the buffer, filling it with the specified relative tile index value.">erase</a>(uint16_t index = 0) {</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;        <a class="code" href="group__memory.html#gabf33fba18a28e7590c7d475a39b7e09e" title="memset(), with an explicit 16-bit data width">memset16</a>(&amp;tiles[0], index, <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a74e1b997c412645e51c6bf99f6e970a0" title="Returns the size of this drawable&#39;s tile data, in 16-bit words.">sizeInWords</a>());</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    }</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;</div>
<div class="line"><a name="l00573"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ae2bd40aec32f535ebdd339dff23e66e8">  573</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ae2bd40aec32f535ebdd339dff23e66e8" title="Erase the buffer, filling it with the first tile from the specified PinnedAssetImage.">erase</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>) {</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#a43d3af91bf282b314e63f0c903f9fc85" title="Access the AssetGroup instance associated with this AssetImage.">assetGroup</a>());</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#abedc46569e3b27d25b6f84436f7f7d1f" title="Erase the buffer, filling it with the specified relative tile index value.">erase</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(0));</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;    }</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;</div>
<div class="line"><a name="l00583"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff">  583</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> frame = 0) {</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        <span class="keywordflow">return</span> pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + (pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + frame * <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>()) * <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>();</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;    }</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;</div>
<div class="line"><a name="l00593"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6989c74e71376078b7c0a9d9f77c13b7">  593</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6989c74e71376078b7c0a9d9f77c13b7" title="Plot a single tile, by relative tile index, at linear position &#39;i&#39;.">plot</a>(<span class="keywordtype">unsigned</span> i, uint16_t tileIndex) {</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(i &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b" title="Return the total number of tiles in every frame of the image.">numTiles</a>());</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;        tiles[i] = tileIndex;</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;    }</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;</div>
<div class="line"><a name="l00604"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa409cae80cc4a517a9f2ee5ad8d23c8c">  604</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa409cae80cc4a517a9f2ee5ad8d23c8c" title="Plot a single tile, by relative tile index, at location &#39;pos&#39; in tile units, on the given frame...">plot</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, uint16_t tileIndex, <span class="keywordtype">unsigned</span> frame = 0) {</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; frame &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;        tiles[<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, frame)] = tileIndex;</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;    }</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;</div>
<div class="line"><a name="l00612"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ac883c88e68dfd4b290991c2801c1a855">  612</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ac883c88e68dfd4b290991c2801c1a855" title="Returns the relative index of the tile at linear position &#39;i&#39; in the image.">tile</a>(<span class="keywordtype">unsigned</span> i)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(i &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b" title="Return the total number of tiles in every frame of the image.">numTiles</a>());</div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;        <span class="keywordflow">return</span> tiles[i];</div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;    }</div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;</div>
<div class="line"><a name="l00621"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ab3a510868aed66fa2c9d65a54bea538b">  621</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ab3a510868aed66fa2c9d65a54bea538b" title="Return the relative index of the tile at the specified (x, y) tile coordinates, and optionally on the...">tile</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> pos, <span class="keywordtype">unsigned</span> frame = 0)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; frame &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;        <span class="keywordflow">return</span> tiles[<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, frame)];</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;    }</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;</div>
<div class="line"><a name="l00632"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a2813e823056ad37358c086f268e302d8">  632</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a2813e823056ad37358c086f268e302d8" title="Plot a horizontal span of tiles, by relative tile index, given the position of the leftmost tile and ...">span</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> width, <span class="keywordtype">unsigned</span> tileIndex, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;    {</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; width &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;            (pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + width) &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>());</div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;        <a class="code" href="group__memory.html#gabf33fba18a28e7590c7d475a39b7e09e" title="memset(), with an explicit 16-bit data width">memset16</a>(&amp;tiles[<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, frame)], tileIndex, width);</div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;    }</div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;</div>
<div class="line"><a name="l00644"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ab0ebc5dcd0034acb371e0880a291eb2d">  644</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a2813e823056ad37358c086f268e302d8" title="Plot a horizontal span of tiles, by relative tile index, given the position of the leftmost tile and ...">span</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keywordtype">unsigned</span> width, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;    {</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#a43d3af91bf282b314e63f0c903f9fc85" title="Access the AssetGroup instance associated with this AssetImage.">assetGroup</a>());</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a2813e823056ad37358c086f268e302d8" title="Plot a horizontal span of tiles, by relative tile index, given the position of the leftmost tile and ...">span</a>(pos, width, image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(0), frame);</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;    }</div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;</div>
<div class="line"><a name="l00656"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a9c31caf180cd4422d57b300a917d41a4">  656</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a9c31caf180cd4422d57b300a917d41a4" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keywordtype">unsigned</span> tileIndex, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;    {</div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;        <span class="keywordflow">while</span> (size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>) {</div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;            <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a2813e823056ad37358c086f268e302d8" title="Plot a horizontal span of tiles, by relative tile index, given the position of the leftmost tile and ...">span</a>(topLeft, size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a>, tileIndex, frame);</div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;            size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>--;</div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;            topLeft.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a>++;</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;        }</div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;    }</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;</div>
<div class="line"><a name="l00671"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1b08a1d992a526fbc5b98cd0d11347a3">  671</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a9c31caf180cd4422d57b300a917d41a4" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> topLeft, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_pinned_asset_image.html" title="An AssetImage in which all tiles are stored sequentially in memory.">PinnedAssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <span class="keywordtype">unsigned</span> frame = 0)</div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;    {</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#a43d3af91bf282b314e63f0c903f9fc85" title="Access the AssetGroup instance associated with this AssetImage.">assetGroup</a>());</div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a9c31caf180cd4422d57b300a917d41a4" title="Fill a rectangle of identical tiles, specified as a top-left corner location and a size...">fill</a>(topLeft, size, image.<a class="code" href="struct_sifteo_1_1_pinned_asset_image.html#acae95d334dc7ae91830e26cc8389bcb4" title="Returns the index of the tile at linear position &#39;i&#39; in the image.">tile</a>(0), frame);</div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;    }</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;</div>
<div class="line"><a name="l00686"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759">  686</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> pos, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <span class="keywordtype">unsigned</span> srcFrame = 0, <span class="keywordtype">unsigned</span> destFrame = 0)</div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;    {</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(image.<a class="code" href="struct_sifteo_1_1_asset_image.html#afe1219ed666fe6542833d66e92411131" title="Access the AssetGroup instance associated with this AssetImage.">assetGroup</a>());</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + image.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>() &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;               pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; pos.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + image.<a class="code" href="struct_sifteo_1_1_asset_image.html#a7ff2fd5e83e49e79b376df2c8b156bbd" title="The height of this image, in tiles.">tileHeight</a>() &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp;</div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;               destFrame &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;        _SYS_image_memDraw(&amp;tiles[<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(pos, destFrame)],</div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;            _SYS_CUBE_ID_INVALID, image, <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>(), srcFrame);</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;    }</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;</div>
<div class="line"><a name="l00705"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa6a7e479787cb8dfbacdde940bbacac3">  705</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> destXY, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> size, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#aa5f9b9207610a81611a21e457968d759" title="Draw a full AssetImage frame, with its top-left corner at the specified location.">image</a>, <a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">UInt2</a> srcXY,</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;        <span class="keywordtype">unsigned</span> srcFrame = 0, <span class="keywordtype">unsigned</span> destFrame = 0)</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;    {</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(image.<a class="code" href="struct_sifteo_1_1_asset_image.html#afe1219ed666fe6542833d66e92411131" title="Access the AssetGroup instance associated with this AssetImage.">assetGroup</a>());</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp; destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> + size.<a class="code" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9" title="Vector component X.">x</a> &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() &amp;&amp;</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;               destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp; destXY.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> + size.<a class="code" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec" title="Vector component Y.">y</a> &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#ad7038e2b2cbccc2a34b53585e42f3a92" title="Return the height, in tiles, of this mode.">tileHeight</a>() &amp;&amp;</div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;               destFrame &lt; <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a1fca3a62064157cf49142e8554a1830f" title="Return the number of frames in this image.">numFrames</a>());</div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;        _SYS_image_memDrawRect(&amp;tiles[<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(destXY, destFrame)],</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;            _SYS_CUBE_ID_INVALID, image, <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>(), srcFrame,</div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;            (_SYSInt2*) &amp;srcXY, (_SYSInt2*) &amp;size);</div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;    }</div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;</div>
<div class="line"><a name="l00723"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a72b16cd54e134c98f2897035f9a2df6c">  723</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a72b16cd54e134c98f2897035f9a2df6c" title="Draw text, using an AssetImage as a fixed width font.">text</a>(<a class="code" href="struct_sifteo_1_1_vector2.html" title="Generalized two-element cartesian coordinate vector.">Int2</a> topLeft, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_asset_image.html" title="Any kind of asset image, as defined in your stir script.">AssetImage</a> &amp;font, <span class="keyword">const</span> <span class="keywordtype">char</span> *str,</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;        <span class="keywordtype">unsigned</span> destFrame = 0, <span class="keywordtype">char</span> firstChar = <span class="charliteral">&#39; &#39;</span>)</div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;    {</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;        <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a19ec083ce72ca919b4e28ae748426acf" title="Set the AssetGroup associated with this buffer.">setAssetGroup</a>(font.<a class="code" href="struct_sifteo_1_1_asset_image.html#afe1219ed666fe6542833d66e92411131" title="Access the AssetGroup instance associated with this AssetImage.">assetGroup</a>());</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;        uint16_t *addr = &amp;tiles[<a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8e063d20add1a224e08dc6afef7059ff" title="Calculate the video buffer address of a particular tile.">tileAddr</a>(topLeft, destFrame)];</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;        uint16_t *lineAddr = addr;</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;        <span class="keywordtype">char</span> c;</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;        <span class="keywordflow">while</span> ((c = *str)) {</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;            <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;\n&#39;</span>) {</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;                addr = (lineAddr += <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>());</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;                <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(font.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>() + (font.<a class="code" href="struct_sifteo_1_1_asset_image.html#a7ff2fd5e83e49e79b376df2c8b156bbd" title="The height of this image, in tiles.">tileHeight</a>() - 1) * <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>() + addr</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;                    &lt;= <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a6f841784204ff7c65b208c9c043a2b0b" title="Return the total number of tiles in every frame of the image.">numTiles</a>() + tiles);</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;                _SYS_image_memDraw(addr, _SYS_CUBE_ID_INVALID, font, <a class="code" href="struct_sifteo_1_1_relocatable_tile_buffer.html#a8243cdb28ff5d1159fe4efeb587bd11a" title="Return the width, in tiles, of this mode.">tileWidth</a>(), c - firstChar);</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;                addr += font.<a class="code" href="struct_sifteo_1_1_asset_image.html#adaba620b7063de2be6abba13e9857169" title="The width of this image, in tiles.">tileWidth</a>();</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;            }</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;            str++;</div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;        }</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    }</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;};</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;};  <span class="comment">// namespace Sifteo</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
